/**
 * One Map 常量定义
 */

// 地图ID
export const MAP_ID = 'one-map'

// 图层ID常量
export const LAYER_IDS = {
  BUILDING_POINT: 'building-point-markers',
  BUILDING_POINT_SOURCE: 'building-point-source',
  HIGHLIGHT: 'highlight-layer'
}

// 事件名称常量
export const EVENTS = {
  MEASURE_ACTIVATE: 'MEASURE_ACTIVATE',
  TOGGLE_SERVICE: 'TOGGLE_SERVICE',
  UPDATE_BUILDING_POINTS: 'UPDATE_BUILDING_POINTS',
  CLEAR_BUILDING_POINTS: 'CLEAR_BUILDING_POINTS',
  UPDATE_LABEL_LAYER: 'UPDATE_LABEL_LAYER',
  TOGGLE_SPECIAL_LAYER: 'TOGGLE_SPECIAL_LAYER',
  CHECK_SPECIAL_LAYER_STATUS: 'CHECK_SPECIAL_LAYER_STATUS',
  UPDATE_SELECTED_BUILDINGS: 'UPDATE_SELECTED_BUILDINGS',
  CLEAR_SELECTED_BUILDINGS: 'CLEAR_SELECTED_BUILDINGS',
  REMOVE_SELECTED_BUILDINGS: 'REMOVE_SELECTED_BUILDINGS',
  LOCATE_TO_BUILDINGS: 'LOCATE_TO_BUILDINGS',
  ENABLE_BUILDING_CLICK: 'ENABLE_BUILDING_CLICK',
  DISABLE_BUILDING_CLICK: 'DISABLE_BUILDING_CLICK',
  NONE_CLICK: 'NONE_CLICK',
  CHANGE_RIGHT_TAB: 'CHANGE_RIGHT_TAB',
  CLOSE_LEFT_PANEL: 'CLOSE_LEFT_PANEL',
  OPEN_LEFT_PANEL: 'OPEN_LEFT_PANEL',
  CLEAR_BUILDING_LABELS: 'ClEAR_BUILDING_LABELS',
  TAB_DETAIL: 'tabDetail',
  ADJUST_LAYER_OPACITY_FOR_SELECTION: 'ADJUST_LAYER_OPACITY_FOR_SELECTION',
  TOGGLE_URL_LAYER: 'TOGGLE_URL_LAYER',
}

// 样式配置常量
export const LAYER_STYLES = {
  point: {
    type: 'circle',
    paint: {
      'circle-radius': 10,
      'circle-color': 'rgba(0, 186, 255, 0.4)',
      'circle-stroke-color': 'rgba(0, 120, 255, 1)',
      'circle-stroke-width': 3,
    },
  },
  line: {
    type: 'line',
    paint: {
      'line-color': 'rgba(0, 186, 255, 0.6)',
      'line-width': 4,
      'line-opacity': 1,
    },
  },
  polygon: {
    type: 'fill',
    paint: {
      'fill-color': 'rgba(0, 186, 255, 0.25)',
      'fill-outline-color': 'rgba(0, 120, 255, 1)',
    },
  },
}

// 默认底图配置
export const DEFAULT_BASE_MAP_CONFIG = {
  type: 'amap',
  name: '高德',
  id: 'amap',
}

// 默认底图列表
export const DEFAULT_BASE_MAP_LIST = [
  {
    type: 'amap',
    id: 'amap',
    name: '高德',
    thumbnail: 'amap.png',
  },
  {
    type: 'vector',
    id: 'vector',
    name: '矢量',
    thumbnail:
      'https://img0.baidu.com/it/u=1183561183,2576002473&fm=253&fmt=auto&app=138&f=GIF?w=220&h=160',
  },
  {
    type: 'imagery',
    id: 'imagery',
    name: '影像',
    thumbnail:
      'https://img2.baidu.com/it/u=2147880393,3055488397&fm=253&fmt=auto&app=138&f=JPEG?w=200&h=150',
  },
]

// 默认区域参数
export const DEFAULT_AREA_PARAMS = {
  streetId: '',
  communityId: '',
  regionId: '',
}

// 默认弹窗配置
export const DEFAULT_POPUP_CONFIG = {
  anchor: 'bottom',
  closeOnClick: false,
  closeButton: false,
  offset: [0, -10],
  className: 'info-window__wrapper',
  maxWidth: '299px',
}

// 地图默认中心点和缩放
export const DEFAULT_MAP_CENTER = [106.49328310804757, 29.768499553618765]
export const DEFAULT_MAP_ZOOM = 12

// 默认建筑物选中样式
export const DEFAULT_SELECT_BUILDING_STYLE = {
  style: {
    paint: {
      'fill-color': '#007bff',
      'fill-opacity': 0.6,
      'fill-outline-color': '#0056b3'
    }
  }
}

// 默认建筑物样式
export const DEFAULT_BUILDING_STYLE = {
  style: {
    paint: {
      'fill-color': '#cccccc',
      'fill-opacity': 0.4,
      'fill-outline-color': '#cccccc'
    }
  }
}


